package com.jiangyg.devtools.ui.table.cell;

import com.intellij.ui.components.JBPanel;
import com.jiangyg.devtools.ui.IconLabel;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * 类描述：操作单元格渲染器
 *
 * @author jiangyg
 * @version 1.0
 * @date 2023年08月29日
 */
public class OperationalCellRenderer implements TableCellRenderer {

    @Override
    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row, int column) {
        final JBPanel<?> toolbar = new JBPanel<>(new FlowLayout());
        toolbar.add(new IconLabel("add"));
        toolbar.add(new IconLabel("delete"));
        return toolbar;
    }

}
